package com.itheima.service.impl;

import com.itheima.domain.Dep;
import com.itheima.domain.Patient;
import com.itheima.mapper.DepMapper;
import com.itheima.mapper.PatientMapper;
import com.itheima.service.PatientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("patientService")
public class PatientServiceImpl implements PatientService {

    @Autowired
    private PatientMapper patientMapper;
    @Autowired
    private DepMapper depMapper;

    @Override
    public List<Patient> findByName(String name) {
        return patientMapper.findByName(name);
    }

    @Override
    public List<Patient> findAll() {
        return patientMapper.findAll();
    }

    @Override
    public void save(Patient patient) {
        patientMapper.save(patient);
    }

    @Override
    public List<Dep> findDepAll() {

        return depMapper.findDepAll();
    }
}
